package com.noble.meether.logic.common.bean;

import com.noble.glamour.module.logic.socket.TCPConstant;
import com.noble.library.base.bean.BaseData;

import org.json.JSONObject;

/**
 * 服务端指派的消息服务器
 */
public class Server extends BaseData {
    private String ip;      // 消息IP地址
    private int portTcp;    // tcp服务端口

    @Override
    public void parseJson(String jsonStr) {
        JSONObject jsonObject = getJsonObject(jsonStr);

        this.ip = jsonObject.optString("IpMsg");
        this.portTcp = jsonObject.optInt("PortTcp");

        TCPConstant.setTcpHost(ip);
        TCPConstant.setTcpPort(portTcp);
    }
}
